import { createRouter, createWebHashHistory } from 'vue-router'
import { routes } from './route.js'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: routes,
})

router.beforeEach((to, from, next) => {
  if (to.meta?.title) {
    document.title = to.meta?.title;
  }

  next();
})

export default router
